import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {
	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int testCase = 1;
		while(true) {
			String str = br.readLine().trim();
			if(str.equals("0")) {
				break;
			}
			StringTokenizer sToken = new StringTokenizer(str, " ");
			int n = Integer.parseInt(sToken.nextToken());
			int[] a = new int[n];
			int sum = 0;
			for(int i = 0; i < n; i++) {
				a[i] = Integer.parseInt(sToken.nextToken());
				sum += a[i];
			}
			
			Integer[][] mem = new Integer[n][n];
			int myScore = game(a, 0, n - 1, mem);
			int oponentScore = sum - myScore;
			System.out.println("In game " + testCase++ +", the greedy strategy might lose by as many as " + (myScore - oponentScore) +" points.");
		}
	}
	
	
//	private static int gameIterative(int[] a) {
//		int[][] mem = new int[a.length][a.length];
//		for(int k = 1; k <= a.length;)
//	}
	
	private static int game(int[] a, int start, int end, Integer[][] mem) {
		if(mem[start][end] != null) {
			return mem[start][end];
		}
		
		if(end - start == 1) {
			int val = Math.max(a[start], a[end]);
			mem[start][end] = val;
			return val;
		}
		
		int v1 = a[start];
		if(a[start + 1] >= a[end]) {
			v1 += game(a, start + 2, end, mem);
		} else {
			v1 += game(a, start + 1, end - 1, mem);
		}
		
		int v2 = a[end];
		if(a[start] >= a[end - 1]) {
			v2 += game(a, start + 1, end - 1, mem);
		} else {
			v2 += game(a, start, end - 2, mem);
		}
		
		mem[start][end] = Math.max(v1, v2);
		return mem[start][end];
	}

}
